package com.gopay.common.cps.dao.bank.impl;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.bank.BisMicroPayDAO;
import com.gopay.common.domain.bis.BisMicroPayConfig;

/** 
 * 小额免密支付DAO实现类
 * @ClassName: BisMicroPayDAOImpl 
 * @author w_jiqing 
 * @date 2017年5月23日 上午11:10:40  
 */ 
@Repository("bisMicroPayDAO")
public class BisMicroPayDAOImpl extends BaseDAOImpl<BisMicroPayConfig, Serializable> implements BisMicroPayDAO{



    @Override
    public BisMicroPayConfig getBisMicroPayByBankCodeAndInterfaceCode(String bankCode, String interfaceCode) {
        Map<String,Object> params = new HashMap<String,Object>();
        params.put("bankCode", bankCode);
        params.put("chCode", interfaceCode);
        List<BisMicroPayConfig> l = super.findByHql("from BisMicroPayConfig where del=0 and bankCode=:bankCode and chCode =:chCode ", params);
        return l.size() > 0 ? l.get(0) : null;
    }

    @Override
    public List<BisMicroPayConfig> getBisMicroPayConfigByBankCode(String bankCode) {
        Map<String,Object> params = new HashMap<String,Object>();
        params.put("bankCode", bankCode);
        return super.findByHql("from BisMicroPayConfig where del=0 and bankCode=:bankCode and enable=1 ", params);
    }

}
